package SA.teacher.manage;

import java.util.*;

import SA.teacher.MainActivity;
import SA.teacher.R;
import SA.teacher.R.drawable;
import SA.teacher.R.id;
import SA.teacher.R.layout;
import SA.teacher.daily.DailyActivity1;
import android.app.Activity;
import android.content.*;
import android.os.Bundle;
import android.util.Log;
import android.view.*;
import android.view.View.*;
import android.widget.*;

public class ManageActivity1 extends Activity {

	ListView list;
	MyAdapter adapter;
	ArrayList<ManageData> arrData;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.manage1);

		Intent intent = getIntent();
		String getClassName = intent.getStringExtra("classname");
		TextView className = (TextView) findViewById(R.id.className);
		className.setText(getClassName + " 반");

		setListData();
		adapter = new MyAdapter(this, arrData);

		list = (ListView) findViewById(R.id.list);
		list.setAdapter(adapter);

		//////////////////////////////////////////////////////////////
		ImageView mainBtn = (ImageView) findViewById(R.id.mainBtn);
		mainBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				mainActivity();
			}
		});
		
		ImageView dailyBtn = (ImageView) findViewById(R.id.dailyBtn);
		dailyBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				dailyActivity();
			}
		});

		//////////////////////////////////////////////////////////////
	}

	private void setListData() {
		arrData = new ArrayList<ManageData>();
		arrData.add(new ManageData(R.drawable.ic_launcher, "학생1",
				R.drawable.roundbtn, R.drawable.roundbtn));
		arrData.add(new ManageData(R.drawable.ic_launcher, "학생2",
				R.drawable.roundbtn, R.drawable.roundbtn));
		arrData.add(new ManageData(R.drawable.ic_launcher, "학생3",
				R.drawable.roundbtn, R.drawable.roundbtn));
	}

	//////////////////////////////////////////////////////////////
	void mainActivity() {
		Intent intent = new Intent(this, MainActivity.class);
		startActivity(intent);
	}
	
	void dailyActivity() {
		Intent intent = new Intent(this, DailyActivity1.class);
		startActivity(intent);
	}
	//////////////////////////////////////////////////////////////

}
